<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateInformationTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('information', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('id');
            $table->string('name',100)->unique()->index()->null()->default('')->comment('标签名称');
            $table->string('img', 255)->null()->default('')->comment('资讯图片');
            $table->string('content', 255)->null()->default('')->comment('资讯内容');
            $table->unsignedInteger('created_at')->null()->default('0')->comment('时间');
            $table->integer('browse_num')->null()->default('0')->comment('浏览数');
            $table->integer('comment_num')->null()->default('0')->comment('评论数');
            $table->tinyInteger('recommend')->null()->default('0')->comment('是否推荐 1推荐 2不推荐');
            $table->string('adress', 255)->null()->default('')->comment('资讯来源');
            $table->string('type',20)->null()->default('')->comment('资讯类型');

        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('information');
    }
}
